﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GetVehicleSerivce.aspx.cs"
    Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>记录客户所需服务</title>

    <script language="javascript" type="text/javascript">
        var tmpnum = '0';
        var strparts = '';
        var strpartsid = '';
        var strpartnum = '';
        function addRow() {
            var row1 = idtb.insertRow(idtb.rows.length)
            tmpnum = row1.rowIndex
            if (tmpnum < 6) {
                var td1 = row1.insertCell(0)
                td1.innerHTML = "查看零件名称并获取零件编号："
                var td2 = row1.insertCell(1)
                td2.innerHTML = " <input id='txtPartsName" + tmpnum + "'  type='text'  onclick='showdialog()' readonly='true'></input> "
                var td3 = row1.insertCell(2)
                td3.innerHTML = "需要零件数量:"
                var td4 = row1.insertCell(3)
                td4.innerHTML = " <input id='txt" + tmpnum + "' type='text'></input> "

            }
            else {
                idtb.deleteRow(tmpnum)
            }
            //            for (var i = 0; i < idtb.rows.length; i++) {
            //                var s =s+ ("txt" + i).name;
            //                alert(s)
            //            }
        }
        function delRow() {
            var sIndex = idtb.rows.length - 1
            if (sIndex > 0)
                idtb.deleteRow(sIndex);
        }
        function showdialog() {
            var returnValue = window.showModalDialog("PartsDialog.aspx", "xx", "dialogWidth=600px;dialogHeight=400px;");
            var txtName = "txtPartsName" + tmpnum;
            var txtNum = "txt" + tmpnum;
            var txtobject = document.getElementById(txtName);
            var txtNumobject = document.getElementById(txtNum);
            //            var txtobject = document.getElementById('<%=txtPartsName.ClientID %>');
            txtobject.value = returnValue;
            //            strpartsid = strpartsid + txtobject.value + ',';
            //            strpartnum = strpartnum + txtNumobject.value+',';
            //            if (txtName == "txtPartsName1") {
            //                var txt1object = document.getElementById(txtName);
            //                var txtnum1object = document.getElementById('txt1');
            //                txt1object.value = returnValue;
            //                var strparts1 = txt1object.value + ',' + txtnum1object.value + ';';
            //            }
            //            else {
            //                // strparts1 = '';
            //            }
            //            if (txtName == "txtPartsName2") {
            //                var txt2object = document.getElementById(txtName);
            //                var txtnum2object = document.getElementById('txt2');
            //                txt2object.value = returnValue;
            //                var strparts2 = txt2object.value + ',' + txtnum2object.value + ';';
            //            }
            //            else {
            //                // strparts2 = '';
            //            }
            //            if (txtName == " txtPartsName3") {
            //                var txt3object = document.getElementById(txtName);
            //                var txtnum3object = document.getElementById('txt3');
            //                txt3object.value = returnValue;
            //                var strparts3 = txt3object.value + ',' + txtnum3object.value + ';';
            //            }
            //            else {
            //                //strparts3 = '';
            //            }
            //            if (txtName == "txtPartsName4") {
            //                var txt4object = document.getElementById(txtName);
            //                var txtnum4object = document.getElementById('txt4');
            //                txt4object.value = returnValue;
            //                var strparts4 = txt4object.value + ',' + txtnum4object.value + ';';
            //            }
            //            else {
            //                //strparts4 = '';
            //            }
            //            if (txtName == "txtPartsName5") {
            //                var txt5object = document.getElementById(txtName);
            //                var txtnum5object = document.getElementById('txt5');
            //                txt5object.value = returnValue;
            //                var strparts5 = txt5object.value + ',' + txtnum5object.value + ';';
            //            }
            //            else {
            //                //strparts5 = '';
            //            }
            //            strparts = strparts1 + strparts2 + strparts3 + strparts4 + strparts5;
            //            //            document.write(strparts);
            //            alert(strparts);
        }
        function getParts() {
            var parts = '';
            for (var i = 1; i <= idtb.rows.length - 1; i++) {
                var txtName = "txtPartsName" + i;
                var txtNum = "txt" + i;
                //var parts = document.getElementById('txtPartsName1').value;

                var partsIdobject = document.getElementById(txtName);
                var partsNumobject = document.getElementById(txtNum);
                var parts = parts + partsIdobject.value + ',' + partsNumobject.value + ';';

            }
            var hiddenobject = document.getElementById('hidden1');
            hiddenobject.value = parts;
            alert('获取成功！点击下一步...');
        }
    </script>

    <script language="javascript" type="text/javascript"> 
        <!--
        function ClientValidate() {

            var flag = false;
            var radioList = document.getElementById("CheckBoxList1");
            var inarr = radioList.getElementsByTagName('input');
            for (var i = 0; i < inarr.length; i++) {
                if (inarr[i].type == "checkbox") {
                    if (inarr[i].checked == true) {
                        flag = true;
                    }
                }
            }
            if (flag) {
                args.IsValid = true;
            }
            else {
                args.IsValid = false;
                alert('请选择服务类型！');
            }
        }
        -->
    </script>

    <script language="javascript" type="text/javascript">

        function contrliframe() {
            var frm = window.frames[0];
            var hidden2 = frm.document.getElementById("hidden2");
            var machidden = document.getElementById("Machidden");
            machidden.value = hidden2.value;
            alert(machidden.value);
        }
    </script>



</head>
<body>
    <form id="form1" runat="server">
    <div style="top: 0px; background-color: #EFF3FB; margin-left: 15%; margin-right: 15%;
        background-color: #CFE7FD;">
        <table style="width: 100%;">
            <tr>
                <td align="center" class="style2">
                    <img alt="" src="App_Themes/主题1/banner.JPG" style="width: 924px; height: 186px" />
                </td>
            </tr>
        </table>
        <table style="width: 99.5%; margin-left: 2px;" bgcolor="#57A4CC">
            <tr>
                <td>
                    <marquee><asp:Label ID ="label1" runat="server" Text ="欢迎使用4S店服务平台"></asp:Label></marquee>
                </td>
            </tr>
        </table>
        <table style="padding: 0px; width: 100%;">
            <tr>
                <td>
                    <asp:Panel ID="Panel1" runat="server">
                        <asp:Label ID="Label4" runat="server" Text="操作流程列表" Font-Size="Larger" Width="155px"></asp:Label>
                        <asp:TreeView ID="TreeView1" runat="server" ImageSet="Arrows">
                            <ParentNodeStyle Font-Bold="False" />
                            <HoverNodeStyle Font-Underline="True" ForeColor="#5555DD" />
                            <SelectedNodeStyle Font-Underline="True" ForeColor="#5555DD" HorizontalPadding="0px"
                                VerticalPadding="0px" />
                            <Nodes>
                                <asp:TreeNode NavigateUrl="~/Main.aspx" Text="平台首页" Value="平台首页">
                                    <asp:TreeNode NavigateUrl="~/Customer.aspx" Text="客户管理" Value="客户管理">
                                        <asp:TreeNode NavigateUrl="~/AddCustomer.aspx" Text="添加客户" Value="添加客户"></asp:TreeNode>
                                        <asp:TreeNode NavigateUrl="~/Customer.aspx" Text="客户信息管理" Value="客户信息管理"></asp:TreeNode>
                                    </asp:TreeNode>
                                    <asp:TreeNode Text="订单管理" Value="订单管理">
                                        <asp:TreeNode NavigateUrl="~/GetOrderInfo.aspx" Text="添加新订单" Value="添加新订单"></asp:TreeNode>
                                        <asp:TreeNode NavigateUrl="~/GetVehicleSerivce.aspx" Text="订单准备" Value="订单准备"></asp:TreeNode>
                                        <asp:TreeNode Text="工作安排显示" Value="工作安排显示"></asp:TreeNode>
                                        <asp:TreeNode Text="订单完成及客户交互" Value="订单完成及客户交互"></asp:TreeNode>
                                    </asp:TreeNode>
                                    <asp:TreeNode Text="实际成本及总费用" Value="实际成本及总费用"></asp:TreeNode>
                                    <asp:TreeNode Text="单据生成" Value="单据生成"></asp:TreeNode>
                                </asp:TreeNode>
                            </Nodes>
                            <NodeStyle Font-Names="Tahoma" Font-Size="10pt" ForeColor="Black" HorizontalPadding="5px"
                                NodeSpacing="0px" VerticalPadding="0px" />
                        </asp:TreeView>
                    </asp:Panel>
                </td>
                <td valign="top" style="background-color: #CFE7FD; width: 775px;">
                    <asp:Wizard ID="wizard1" runat="server" BackColor="#E6E2D8" BorderColor="#999999"
                        BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" Width="100%" ActiveStepIndex="0"
                        BorderStyle="Solid" OnFinishButtonClick="wizard1_FinishButtonClick" OnNextButtonClick="wizard1_NextButtonClick"
                        OnLoad="wizard1_Load" Height="218px">
                        <StepStyle BackColor="#F7F6F3" BorderColor="#E6E2D8" BorderStyle="Solid" BorderWidth="2px" />
                        <WizardSteps>
                            <asp:WizardStep StepType="Start" runat="server" Title="欢迎页面">
                                <asp:Label ID="lbwelcome" runat="server" Text="Label"></asp:Label>
                            </asp:WizardStep>
                            <asp:WizardStep runat="server" Title="服务类型选择" EnableViewState="true">
                                <div style="margin-top: 0px; padding-top: 0px;">
                                    <p>
                                        请选择所需服务类型</p>
                                    <asp:CheckBoxList ID="CheckBoxList1" runat="server" EnableViewState="true" RepeatDirection="Horizontal">
                                    </asp:CheckBoxList>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox1"
                                        ErrorMessage="请选中"></asp:RequiredFieldValidator>
                                    <asp:TextBox ID="TextBox1" runat="server" Visible="False"></asp:TextBox>
                                </div>
                            </asp:WizardStep>
                            <asp:WizardStep runat="server" Title="所需工作场地填写">
                                <p>
                                    选择工作场地并验证是否在使用</p>
                                <p>
                                    <asp:Button ID="btnplace" runat="server" OnClick="Button3_Click" Text="验证" Visible="False" />
                                </p>
                                <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False">
                                    <Columns>
                                        <asp:TemplateField HeaderText="选中">
                                            <EditItemTemplate>
                                                <asp:CheckBox ID="checkplace" runat="server" />
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <asp:CheckBox ID="checkplace" runat="server" />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="_repairplaceId" HeaderText="工作场地编号" />
                                        <asp:BoundField DataField="_repairplaceName" HeaderText="工作场地名称" />
                                        <asp:BoundField DataField="_useState" HeaderText="当前使用状态" />
                                        <asp:TemplateField HeaderText="归还时间">
                                            <ItemTemplate>
                                                <asp:Label ID="lbrtime" runat="server" Text='<%#DataBinder.Eval(Container,"DataItem._returnTime") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                </asp:GridView>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtworkplaceyanzheng"
                                    ErrorMessage="请正确选中"></asp:RequiredFieldValidator>
                                <asp:TextBox ID="txtworkplaceyanzheng" runat="server" Visible="False"></asp:TextBox>
                                <br />
                            </asp:WizardStep>
                            <asp:WizardStep runat="server" Title="所需零件清单填写">
                                <p>
                                    单击添加图标添加记录<span style="color: Red">(单行记录需确定后进行下一行记录添加，否则返回修改无效)</span></p>
                                <table  id="idtb" border="1px" width="100%">
                                    <tr id="idtr">
                                        <td id="idtd1" class="style2">
                                            <%-- <asp:Label ID="Label2" runat="server" Text="查看零件名称并获取零件编号："></asp:Label>--%>
                                        </td>
                                        <td id="idtd2">
                                            <input id="txtPartsName" runat="server" onclick="showdialog()" readonly="readonly"
                                                visible="false" />
                                        </td>
                                        <td id="idtd3" class="style2">
                                            <%-- <asp:Label ID="Label3" runat="server" Text="需要零件数目："></asp:Label>--%>
                                        </td>
                                        <td id="idtd4">
                                            <%--   <asp:TextBox ID="txtPartsNum" runat="server"></asp:TextBox>--%>
                                        </td>
                                    </tr>
                                </table>
                                <table  style="width: 99%">
                                    <tr>
                                        <td align="right">
                                            <img src="Image/add.png" alt="添加" onclick="addRow()" height="10px" />
                                            <img src="Image/del.png" alt="删除" onclick="delRow()" height="10px" />
                                            <input type="button" onclick="getParts()" value="获取所填内容" id="btn" />
                                            <%--<asp:Button ID="Button1" runat="server" Text="点击获取服务信息" OnClick="Button1_Click" />--%>
                                        </td>
                                    </tr>
                                </table>
                                <p>
                                    &nbsp;</p>
                            </asp:WizardStep>
                            <asp:WizardStep runat="server" Title="验证零件库存是否满足">
                                
                                  <p>
                                            <asp:Button ID="btncheck" runat="server" Text="验证" OnClick="btncheck_Click" />
                                            <asp:Image ID="Imgcheck" runat="server" />
                                            <asp:Label ID="lbcheck" runat="server" Text="Label"></asp:Label>
                                    </p>
                             
                                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Width="98%">
                                    <Columns>
                                        <asp:TemplateField HeaderText="选择">
                                            <EditItemTemplate>
                                                <asp:CheckBox ID="CheckBox1" runat="server" />
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <asp:CheckBox ID="CheckBox1" runat="server" />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="PartsId" HeaderText="所需零件编号" ReadOnly="True" />
                                        <asp:BoundField DataField="PartsNum" HeaderText="所需零件数目" />
                                        <asp:CommandField HeaderText="编辑" ShowEditButton="True" />
                                    </Columns>
                                </asp:GridView>
                            </asp:WizardStep>
                            <asp:WizardStep runat="server" Title="所需机器清单填写">
                                <iframe id="iframe1" runat="server" scrolling="no" src="GetMachineInfo.aspx" width="100%"
                                    style="font-size: 80%; background-color: #EFF3FB" frameborder="0" height="200px">
                                </iframe>
                            </asp:WizardStep>
                            <asp:WizardStep runat="server" Title="验证机器库存是否满足">
                                <p>
                                    <asp:Button ID="btnMcheck" runat="server" Text="验证" OnClick="btnMcheck_Click" 
                                        style="width: 40px" />
                                    <asp:Image ID="imgMcheck" runat="server" />
                                    <asp:Label ID="lbMcheck" runat="server" Text="Label"></asp:Label>
                                    <asp:Label ID="lbMreturn" runat="server" Text="Label" Visible="false"></asp:Label></p>
                                <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" Width="91%">
                                    <Columns>
                                        <asp:TemplateField HeaderText="选择">
                                            <EditItemTemplate>
                                                <asp:CheckBox ID="Mcheck" runat="server" />
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <asp:CheckBox ID="Mcheck" runat="server" />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="MachineId" HeaderText="所需机器编号" ReadOnly="True" />
                                    </Columns>
                                </asp:GridView>
                            </asp:WizardStep>
                            <asp:WizardStep runat="server" Title="工时填写">
                                <asp:Label ID="Label2" runat="server" Text="预计工时："></asp:Label>
                                <asp:TextBox ID="txtUseTime" runat="server" Width="77px"></asp:TextBox>
                                <asp:Label ID="Label3" runat="server" Text="天"></asp:Label>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtUseTime"
                                    ErrorMessage="不为空"></asp:RequiredFieldValidator>
                                <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="txtUseTime"
                                    ErrorMessage="类型不对" Operator="GreaterThan" Type="Double" ValueToCompare="0"></asp:CompareValidator>
                            </asp:WizardStep>
                        </WizardSteps>
                        <SideBarButtonStyle ForeColor="White" />
                        <NavigationButtonStyle BackColor="White" BorderColor="#C5BBAF" BorderStyle="Solid"
                            BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" ForeColor="#1C5E55" />
                        <SideBarStyle BackColor="#1C5E55" Font-Size="0.9em" VerticalAlign="Top" />
                        <HeaderStyle BackColor="#666666" BorderColor="#E6E2D8" BorderStyle="Solid" BorderWidth="2px"
                            Font-Bold="True" Font-Size="0.9em" ForeColor="White" HorizontalAlign="Center" />
                        <HeaderTemplate>
                            <asp:Label ID="Label1" runat="server" Text="记录客户所需服务"></asp:Label>
                        </HeaderTemplate>
                    </asp:Wizard>
                    <input type="hidden" id="hidden1" runat="server" />
                    <input type="hidden" id="Machidden" runat="server" />
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
